/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.api.manager.context;

import com.inspur.edp.bef.api.lcp.AuthInfo;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.dependenceTemp.Pagination;
import com.inspur.edp.cef.entity.entity.IEntityData;

import java.util.ArrayList;

/**
 * 查询上下文
 * 查询前，查询，查询后扩展动作共用一个查询上下文
 * 扩展动作执行顺序可参考：<a href=https://open.inspuronline.com/iGIX/#/document/mddoc/docs-gsp-cloud-ds%2Fdev-guide-beta%2Fadvanced-development%2Fvo-relatedcomponent-development%2F%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C%2Fvo%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C.md">点击这里</a>查看。
 */
public class QueryContext {

    private EntityFilter filter;
    private ArrayList<IEntityData> queryResult = new ArrayList<IEntityData>();
    private IEntityData param;
    private Pagination pagination;
    private String extendCond;
    private boolean useCustomAuth = false;
    private AuthInfo authInfo;

    /**
     * 获取外部设置的过滤条件
     *
     * @return
     * @see EntityFilter
     */
    public final EntityFilter getFilter() {
        return filter;
    }

    /**
     * 设置过滤条件
     */
    public final void setFilter(EntityFilter value) {
        filter = value;
    }

    /**
     * 获取查询结果，这里的数据时经过数据Mapping转换之后的vo数据集
     */
    public final ArrayList<IEntityData> getQueryResult() {
        return queryResult;
    }

    /**
     * 设置查询数据结果集
     *
     * @param value
     */
    public final void setQueryResult(ArrayList<IEntityData> value) {
        queryResult = value;
    }

    /**
     * 获取QO传入实体数据
     *
     * @return
     * @see IEntityData
     */
    public final IEntityData getParam() {
        return param;
    }

    /**
     * QO设置实体数据
     *
     * @param value
     */
    public final void setParam(IEntityData value) {
        param = value;
    }

    /**
     * 获取分页信息
     *
     * @return
     * @see Pagination
     */
    public final Pagination getPageInfo() {
        return pagination;
    }

    /**
     * 设置分页信息
     *
     * @param value
     */
    public final void setPageInfo(Pagination value) {
        pagination = value;
    }

    public final String getExtendCond() {
        return extendCond;
    }

    public final void setExtendCond(String value) {
        extendCond = value;
    }

    public boolean getUseCustomAuth() {
        return useCustomAuth;
    }

    public void setUseCustomAuth(boolean value) {
        useCustomAuth = value;
    }

    /**
     * 获取权限信息
     *
     * @return
     * @see AuthInfo
     */
    public AuthInfo getAuthInfo() {
        return authInfo;
    }

    /**
     * 设置权限信息
     *
     * @param value
     */
    public void setAuthInfo(AuthInfo value) {
        authInfo = value;
    }
}
